﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="format-detection" content="telephone=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
    <title>邀请码</title>
    <link rel="stylesheet" href="css/style.css?v=1.11">
    <link rel="stylesheet" href="css/index.css?v=1.11">
    <script src="js/jquery-1.8.3.min.js?v=1.11"></script>
    <script src="js/flexible.js?v=1.11"></script>
    <script src="layer-mobile/layer.js?v=1.11"></script>
</head>
	<body>
		<header id="header">
			<div class="back" onclick="closeWin();">
				<img src="image/back.png">
			</div>
			<div class="title">邀请好友</div>
		</header>
		<section class="invite clearfix">
			<div class="invite-content">
				
                <div class="invite-box">
                    <p class="invite-code">我的邀请码</p>
                    <input class="code" id="website" value="">
                    <button type="button" id="copy" data-clipboard-action="copy" data-clipboard-target="#website">复制</button>
                    <p class="residue">剩余邀请次数：<span id="residue">0</span></p>
                    <div class="ewm">
                        <img src="" id="ewm">
                    </div>
                    <p class="sweep-h">
                        邀请一名好友+10算力，最多享六级返利。
                        算力越高，代币越多！
                    </p>
                    <p class="sweep">扫码下载得币app</p>
                    <p class="lift">开启个人价值共享平台</p>
                </div>
			</div>
			<a href="invite-details.html" class="details">邀请详情</a>
		</section>
	</body>
</html>
<script src="js/clipboard.min.js"></script>
<script type="text/javascript" async="async">
    
    $(function () {
	//复制文本
    var clipboard = new ClipboardJS('#copy');

    clipboard.on('success', function(e) {
        layer.open({
 			content: '已复制到剪切板',
 			btn: 'ok'
		});
    });

    clipboard.on('error', function(e) {
        layer.open({
			content: '您当前不支持复制',
			btn: '我知道了'
		});
    });

    var _height = $(document).height();
    var height_ = $('#header').height();
        $('.invite').css('height', _height - height_);

    var userid = getUserId();//获取userid
        
    $ajax(
		url+'getInviteFriendsInfo.ashx',
		'post',
		{userid:userid},
		function(data){
			data =data.data;
			
			$('#website').val(data.referralCode);
            $('#residue').html(data.refCodeRemainCount);
            $('#ewm').attr('src', data.link);
		},
        function (data) {
            loginRes();
		}
    )
    })
</script>